
********************************************************************************
*
* Title:	DOES SPORTSWASHING WORK?
* 			FIRST INSIGHTS FROM THE 2022 WORLD CUP IN QATAR
*
* Authors: 	Christian Glaessel, Adam Scharpf, Pearce Edwards
*
* Journal:	Journal of Politics
*
* Date:		October 2023
*
********************************************************************************
*
* Content:	Replication of results in the manuscript and online appendix
*
*			Steps:
*			1) Set working directory
*			2) Load dataset
*			3) Replicate results and figures
*
********************************************************************************
*
* Packages: Before running this code, please make sure you have the following
*			.ado-files installed
*
*			- Parmest Package, Version 2
*					net install st0043_2.pkg
*
*			- Violinplot Package, Version 1.1.2
*					net install violinplot.pkg
*
*			- Center Package, Version 1.10
*					ssc install center
*
********************************************************************************

	version 16.0
	set more off

	clear all
 
 
********************************************************************************
*
* Setting working directory in macro
*
********************************************************************************

	*Insert path to folder containing datasets before running
	global path="..." //Example: "C:\Users\me\Desktop\Glaessel_Scharpf_Edwards_Sportswashing_JoP_Replication"
 
 
********************************************************************************
*
* Producing log-file of results
*
********************************************************************************

	*Start recording log file
	log using "$path\replication_log", replace
	
	
********************************************************************************
*
* Figures in manuscript
*
********************************************************************************	
	
	****************************************************************************
	*Figure 1. Autocratic hosts of international sports events, 1950-2024
	****************************************************************************	
	
	*Loading dataset
	use "$path\sportsevents_data.dta", clear	
	
	*Generating 5-year interval variable
	gen time=1 if year>=1945 & year<1950 
	replace time=2 if year>=1950 & year<1955
	replace time=3 if year>=1955 & year<1960	
	replace time=4 if year>=1960 & year<1965
	replace time=5 if year>=1965 & year<1970	
	replace time=6 if year>=1970 & year<1975	
	replace time=7 if year>=1975 & year<1980	
	replace time=8 if year>=1980 & year<1985		
	replace time=9 if year>=1985 & year<1990	
	replace time=10 if year>=1990 & year<1995 
	replace time=11 if year>=1995 & year<2000
	replace time=12 if year>=2000 & year<2005	
	replace time=13 if year>=2005 & year<2010
	replace time=14 if year>=2010 & year<2015	
	replace time=15 if year>=2015 & year<2020		
	replace time=16 if year>=2020 & year<2025		
	
	*Collapsing data
	collapse (sum) event_selec autoc_host, by(time)
	
	*Generating regime prop
	gen autoc_host_perc=(autoc_host/event_selec)*100
		
	*Graph		
	#delimit ;
	twoway (
			line autoc_host_perc time,
			lcolor(black)
			)
			(
			scatter autoc_host_perc time if time<10,
			mlcolor(black)
			mfcolor(white)
			msize(1.75)	
			)
			(
			scatter autoc_host_perc time if time>=10,
			mlcolor(black)
			mfcolor(black)
			msize(1.75)				
			)
			, 
		ysize(1)
		xsize(1)			
		yscale(range() noextend titlegap(+2))
		ylabel(0(10)70, angle(horizontal) nogrid ) 
		xscale(range(1.5 9.5) noextend titlegap(+3))		
		xlabel(
			   2 "1950-1954" 
			   4 "1960-1964"
			   6 "1970-1974" 
			   8 "1980-1984" 
			   10 "1990-1994" 
			   12 "2000-2004"
			   14 "2010-2014" 
			   16 "2020-2024"
			   , angle(45) noticks labgap(+2))		
		xticks(2(1)16,tlength(*1))		
		ytitle("Autocratic host regimes (in %)", size(*1.2))
		xtitle("Years", size(*1.2))
		legend(off)
		plotregion(lcolor(white)) 
		graphregion(color(white) lcolor(white) lalign(outside))			
	;
	#delimit cr
	graph export "$path\figure_1.pdf", as(pdf) replace	
		

	****************************************************************************
	*Figure 2. Civil liberties in Qatar and all other host countries since 1950
	****************************************************************************		
	
	*Loading dataset
	use "$path\host_data.dta", clear
		
	*Rescaling variable on freedom of religion 0 <-> 1	
	sum v2clrelig
	gen v2clrelig_rs = ( v2clrelig - r(min) ) / ( r(max)-r(min) )		
	sum v2clrelig_rs	
	
	*Rescaling variable on discrimination based on sexual orientation 0 <-> 1	
	sum v2pepwrort
	gen v2pepwrort_rs = ( v2pepwrort - r(min) ) / ( r(max)-r(min) )		
	sum v2pepwrort_rs		
	
	*Renaming variables for reshaping
	rename v2x_freexp vdem4
	rename v2xcl_slave vdem3
	rename v2clrelig_rs vdem2
	rename v2x_gencl vdem1
	rename v2pepwrort_rs vdem5
		
	*Reshaping data
	reshape long vdem@, i(event_id) j(yaxis)
	
	*Sorting data 
	sort cname year
	
	*Generating Qatar identifier
	gen qatar=1 if cname=="Qatar"	
	
	*Generating bars
	gen lo=.
	gen hi=.
	
	replace lo=.7 if qatar==1 & yaxis==1 & year==2022
	replace hi=1.3 if qatar==1 & yaxis==1 & year==2022
	
	replace lo=1.7 if qatar==1 & yaxis==2 & year==2022
	replace hi=2.3 if qatar==1 & yaxis==2 & year==2022
	
	replace lo=2.7 if qatar==1 & yaxis==3 & year==2022
	replace hi=3.3 if qatar==1 & yaxis==3 & year==2022
	
	replace lo=3.7 if qatar==1 & yaxis==4 & year==2022
	replace hi=4.3 if qatar==1 & yaxis==4 & year==2022

	replace lo=4.7 if qatar==1 & yaxis==5 & year==2022
	replace hi=5.3 if qatar==1 & yaxis==5 & year==2022
		
	*Graph
	#delimit ;
	twoway (scatter yaxis vdem if autoc==0, color("250 194 40%25") jitter(3) jitterseed(2148547))
		   (scatter yaxis vdem if autoc==1, color("101 21 110%25") jitter(3) jitterseed(2148547))
		   (rbar hi lo vdem if qatar==1, vertical color("101 21 110") fcolor("101 21 110") lwidth(*1.5)  barwidth(.015))
		   ,
			ysize(1)
			xsize(1.25)			
			yscale(range(.5 5.5) noextend titlegap(*+5))
			xscale(range() noline titlegap(*+7))
			ylabel(5 "LGBT rights" 4 "Freedom of expression" 3 "Workers' rights" 2 "Freedom of religion" 1 "Women's rights",
					valuelabel angle(horizontal) labsize(*.9))	
			xlabel(.1 "{&larr} Low" .9 "High {&rarr}" , notick labsize(*.9))
			ytitle("")
			xtitle("", size(*.8))
			graphregion(color(white) lcolor(white) lalign(outside))
 			legend(off			 
			)
		   ;
	#delimit cr		
	graph export "$path\figure_2.pdf", replace as(pdf)		
		
	
	****************************************************************************
	*Loading survey replication dataset
	****************************************************************************	

	*Loading dataset
	use "$path\survey_data.dta", clear
	
	
	****************************************************************************
	*Figure 3. Public opinion survey in Germany around the start of the 2022 World Cup
	****************************************************************************		
	
	*Preserving data
	preserve
	
	*Generating 6-hour datetime variable
	gen hour=hh(end_german)
	
	gen hour_bin=1 if hour>=0 & hour<6
	replace hour_bin=2 if hour>=6 & hour<12
	replace hour_bin=3 if hour>=12 & hour<18
	replace hour_bin=4 if hour>=18 & hour<24	
	
	*Generating day variable
	gen date=dofc(end_german)
	format date %td
		
	*Generating id variable for aggregating 
	gen count=1
	
	*Aggregating data
	collapse (sum) count, by(hour_bin date) 	
	sort date hour_bin
	
	*Adding dates
	set obs `=_N+4'
	
	forval i=0/3 {
	replace date=td(16nov2022)+(`i'+1) in `=_N-`i'' if date==.
	replace hour_bin=1 in `=_N-`i'' if hour_bin==.
	}
	
	xtset date hour_bin, generic
	tsfill, full
	
	*Generating xaxis
	gen xaxis=_n
	
	*Modifiying bar values
	replace count=0.1 if date<=td(16nov2022) & count==.
	replace count=0.1 if date>=td(21nov2022) & count==.
	
	*Generating lines
	gen xaxis_open=27 if xaxis==27
	gen yaxis_open=400 if xaxis==27
	
	gen xaxis_german=39 if xaxis==39
	gen yaxis_german=400 if xaxis==39
	
	*Graph
	#delimit ;
	twoway (bar count xaxis, lcolor(gs5) color(gs10) base(-1) barwidth(.8) )
		   (spike yaxis_open xaxis_open, lpattern(shortdash) lcolor(black) lwidth(*1.5))
		   (spike yaxis_german xaxis_german, lpattern(shortdash) lcolor(gs5))
		   ,
			ysize(1)
			xsize(1.5)			
			yscale(range() noextend titlegap(*+5))
			xscale(range() noextend titlegap(*+7))
			ylabel(				
			, angle(horizontal) nogrid)
			xlabel(
				   .5 " "
				   2.5 "14"
				   6.5 "15"
				   10.5 "16"
				   14.5 "17"
				   18.5 "18"
				   22.5 "19"
				   26.5 "20"
				   30.5 "21"
				   34.5 "22"
				   38.5 "23"
				   , notick labgap(*2.5)
			)
			xtick(.5(4)40.5,
			)		
			ytitle("Number of respondents")
			xtitle("November 2022")			
			ttext(410 27 "World Cup start", size(*.8) placement(n))
			ttext(410 39 "GER vs. JPN", size(*.8) placement(n))
			graphregion(color(white) lcolor(white) lalign(outside)  margin(t=20 b=25)) 			
			legend(off)
		   ;
	#delimit cr		
	graph export "$path\figure_3.pdf", replace as(pdf)	
	
	*Restoring data
	restore
	
	
	****************************************************************************
	*Figure 4. World Cup start effect on people's agreement with the statements: "Qatar is..." 
	****************************************************************************	

	*Preserving data
	preserve
	
	*Control variables
	#delimit ;
	global controls_2 = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr
		
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qatar_statements_1_influence 
						   qatar_statements_1_aggro
						   qatar_statements_1_tech
						   qatar_statements_1_orga 
						   qatar_statements_1_travel
						   qat_state_2_worker
						   qat_state_2_women
						   qat_state_2_lgbt
						   ";
	#delimit cr	
	
	*Models
	forval j=1/8  {	
	tab ``j''
	
	reg ``j'' wave $controls_2 , robust
	eststo model_2_`j'_1	
	margins , dydx(wave) at((asobserved) _all) level(95) post 	
	parmest, saving("$path\results_fig_4_`j'_95CI.dta", replace) idstr(model_2_`j'_1) format(estimate min95 max95)	
	
	}	
	
	*Loading data
	use "$path\results_fig_4_1_95CI.dta", clear		
	
	forval j=2/8   {
			append using "$path\results_fig_4_`j'_95CI.dta"
    }	
	
	*Extracting dependent variable
	gen dv=regexs(1) if regexm(idstr,"([0-9]+)_([0-9])$")
	
	*Destringing variables
	destring dv, replace
	
	*Generating y-axis variable
	sort dv
	sum dv
	gen yaxis=dv*(-1)+r(max)
	
	*Graph
	#delimit ;
	twoway (rspike min95 max95 yaxis if dv==7, horizontal lcolor(black) lwidth(*1.1))
		   (rspike min95 max95 yaxis if dv!=7, horizontal lcolor(gs10) lwidth(*1.1))
		   (scatter yaxis estimate if dv==7, mcolor(black) msize(*1.15))  
		   (scatter yaxis estimate if dv!=7, mfcolor(white) mlcolor(gs10) msize(*1.25))	 
		   , 
			xline(0, lpattern(shortdash) lcolor(black) lwidth(*0.75)) 
			ysize(1)
			xsize(1.5)			
			yscale(range(-.5 7.25) noextend titlegap(*+5))
			xscale(range(-.35 .35) noextend titlegap(*+7))
			ylabel(
			7 "internationally influential"
			6 "an aggressive country"
			5 "technologically leading"
			4 "well organized"
			3 "an attractive travel destination"
			2 "a bad country for migrant workers"
			1 "treating women as second-class citizens"
			0 "a dangerous country for gays and lesbians"
			, valuelabel angle(horizontal) labsize(*.9) glwidth(*0.75) glcolor(gs15) 
			)	
			xlabel(-.3(0.1).3, labsize(*.9))
			ytitle("")
			xtitle("Average marginal effect", size(*.9))
			graphregion(color(white) lcolor(white) lalign(outside)  margin(t=15 b=15))
 			legend(	off)
		   ;
	#delimit cr		
	graph export "$path\figure_4.pdf", as(pdf) replace	
	
	*Restoring data
	restore
	
	
	****************************************************************************
	*Figure 5. World Cup start effect on people's sympathy towards different world regions
	****************************************************************************	
	
	*Preserving data
	preserve	
	
	*Control variables
	#delimit ;
	global controls_3 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 "
	;
	#delimit cr	
			
	*Arab world
	reg world_regions_arab wave $controls_3 world_regions_russia world_regions_us world_regions_asia world_regions_europe , robust 
	eststo model_3_1_1
	margins , dydx(wave) at((asobserved) _all) level(95) post 	
	parmest, saving("$path\results_fig_5_1_95CI.dta", replace) idstr(model_3_1_1) format(estimate min95 max95)			

	*US
	reg world_regions_us wave $controls_3 world_regions_russia world_regions_arab world_regions_asia world_regions_europe , robust 
	eststo model_3_2_1	
	margins , dydx(wave) at((asobserved) _all) level(95) post 	
	parmest, saving("$path\results_fig_5_2_95CI.dta", replace) idstr(model_3_2_1) format(estimate min95 max95)	
		
	*Asia
	reg world_regions_asia wave $controls_3 world_regions_russia world_regions_arab world_regions_us world_regions_europe , robust 
	eststo model_3_3_1
	margins , dydx(wave) at((asobserved) _all) level(95) post 	
	parmest, saving("$path\results_fig_5_3_95CI.dta", replace) idstr(model_3_3_1) format(estimate min95 max95)	
		
	*Europe
	reg world_regions_europe wave $controls_3 world_regions_russia world_regions_arab world_regions_asia world_regions_us , robust 
	eststo model_3_4_1	
	margins , dydx(wave) at((asobserved) _all) level(95) post 	
	parmest, saving("$path\results_fig_5_4_95CI.dta", replace) idstr(model_3_4_1) format(estimate min95 max95)	
	
	*Loading data
	use "$path\results_fig_5_1_95CI.dta", clear		
	
	forval j=2/4   {
			append using "$path\results_fig_5_`j'_95CI.dta"
    }	
	
	*Extracting dependent variable
	gen dv=regexs(1) if regexm(idstr,"([0-9]+)_([0-9])$")
	
	*Destringing variables
	destring dv, replace
	
	*Generating y-axis variable
	sort dv
	sum dv
	
	gen yaxis=4 if dv==1
	replace yaxis=3 if dv==3
	replace yaxis=2 if dv==4
	replace yaxis=1 if dv==2
			
	*Graph
	#delimit ;
	twoway (rspike min95 max95 yaxis if dv==1, horizontal lcolor(black) lwidth(*1.1))
		   (rspike min95 max95 yaxis if dv!=1, horizontal lcolor(gs10) lwidth(*1.1))
		   (scatter yaxis estimate if dv==1, mcolor(black) msize(*1.15))  
		   (scatter yaxis estimate if dv!=1, mfcolor(white) mlcolor(gs10) msize(*1.25))	
		   , 
			xline(0, lpattern(shortdash) lcolor(black) lwidth(*0.75)) 
			ysize(1)
			xsize(1.2)			
			yscale(range(0.75 4.25) noextend titlegap(*+5))
			xscale(range(-.35 .35) noextend titlegap(*+7))
			ylabel(
			4 "Arab world"
			3 "Asia"
			2 "Western Europe"
			1 "United States"
			, valuelabel angle(horizontal) labsize(*.9) glwidth(*0.75) glcolor(gs15) 
			)	
			xlabel(-.3(0.1).3, labsize(*.9))
			ytitle("")
			xtitle("Average marginal effect", size(*.9))
			graphregion(color(white) lcolor(white) lalign(outside) margin(t=25 b=20))
 			legend(	off 
			)
		   ;
	#delimit cr			
	graph export "$path\figure_5.pdf", as(pdf) replace	
		
	*Restoring data
	restore	
	
	
	****************************************************************************
	*Figure 6. World Cup start effect on agreement with the statements: "German ..."
	****************************************************************************	
	
	*Preserving data
	preserve		
	
	*Control variables
	#delimit ;
	global controls_4 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr	
							
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qat_state_2_speech
						   qat_state_2_critic
						   pol_media_opinion
						   football_boycott_pol 
						   ";
	#delimit cr	

	*Models
	forval j=1/4  {	
	tab ``j''
	
	reg ``j'' wave $controls_4 , robust
	eststo model_4_`j'_1	
	margins , dydx(wave) at((asobserved) _all) level(95) post 	
	parmest, saving("$path\results_fig_6_`j'_95CI.dta", replace) idstr(model_4_`j'_1) format(estimate min95 max95)		

	}		
	
	*Loading data
	use "$path\results_fig_6_1_95CI.dta", clear		
   	
	forval j=2/4   {
			append using "$path\results_fig_6_`j'_95CI.dta"
    }	
		
	*Extracting dependent variable
	gen dv=regexs(1) if regexm(idstr,"([0-9]+)_([0-9])$")
	
	*Destringing variables
	destring dv, replace
	
	*Generating y-axis variable
	sort dv
	sum dv
	gen yaxis=dv*(-1)+r(max)
			
	*Graph
	#delimit ;
	twoway (rspike min95 max95 yaxis, horizontal lcolor(black) lwidth(*1.1))
		   (scatter yaxis estimate, mcolor(black) msize(*1.15))  
		   , 
			xline(0, lpattern(shortdash) lcolor(black) lwidth(*0.75)) 
			ysize(1)
			xsize(1.6)			
			yscale(range(-0.25 3.2) noextend titlegap(*+5))
			xscale(range(-.35 .35) noextend titlegap(*+7))
			ylabel(
			3 "freedom of expression level is similar to Qatar"
			2 "media criticized Qatar too much"				
			1 "media often forces its opinion on people"
			0 "politicians should boycott tournaments in autocracies"
			, valuelabel angle(horizontal) labsize(*.9) glwidth(*0.75) glcolor(gs15) 
			)	
			xlabel(-.3(0.1).3, labsize(*.9))
			ytitle("")
			xtitle("Average marginal effect", size(*.9))
			graphregion(color(white) lcolor(white) lalign(outside) margin(t=25 b=20))
 			legend(	off
			)
		   ;
	#delimit cr		
	graph export "$path\figure_6.pdf", as(pdf) replace
	
	*Restoring data
	restore	
		
	
	****************************************************************************
	*Figure 7. World Cup start effect on agreement with the statements: "In Germany, ..."
	****************************************************************************		

	*Preserving data
	preserve	
	
	*Control variables
	#delimit ;
	global controls_5 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr	
	
	*Dependent variables
	#delimit ;
	tokenize 			   "	
						   pol_woke_female
						   pol_xeno_mosque
						   pol_woke_homo
						   pol_xeno_security
						   ";
	#delimit cr							   

	*Models
	forval j=1/4  {	
	tab ``j''
	
	reg ``j'' wave $controls_5 , robust
	eststo model_5_`j'_1	
	margins , dydx(wave) at((asobserved) _all) level(95) post 	
	parmest, saving("$path\results_fig_7_`j'_95CI.dta", replace) idstr(model_5_`j'_1) format(estimate min95 max95)					

	}			
	
	*Loading data
	use "$path\results_fig_7_1_95CI.dta", clear		
	
	forval j=2/4   {
			append using "$path\results_fig_7_`j'_95CI.dta"
    }	
	
	*Extracting dependent variable
	gen dv=regexs(1) if regexm(idstr,"([0-9]+)_([0-9])$")
	
	*Destringing variables
	destring dv, replace
	
	*Generating y-axis variable
	sort dv
	sum dv
	gen yaxis=dv*(-1)+r(max)
	
	*Graph
	#delimit ;
	twoway (rspike min95 max95 yaxis if dv==3 | dv==4, horizontal lcolor(black) lwidth(*1.1))
		   (rspike min95 max95 yaxis if dv!=3 & dv!=4, horizontal lcolor(gs10) lwidth(*1.1))
		   (scatter yaxis estimate if dv==3 | dv==4, mcolor(black) msize(*1.15))  
		   (scatter yaxis estimate if dv!=3 & dv!=4, mfcolor(white) mlcolor(gs10) msize(*1.25))	
		   , 
			xline(0, lpattern(shortdash) lcolor(black) lwidth(*0.75)) 
			ysize(1)
			xsize(1.8)			
			yscale(range(-0.25 3.25) noextend titlegap(*+5))
			xscale(range(-.35 .35) noextend titlegap(*+7))
			ylabel(
			3 "women face severe professional disadvantages"
			2 "mosques should be allowed to publicly call for prayer"
			1 "homosexuals sometimes exaggerate their demands for equality"
			0 "immigration from other cultures endangers social peace & security"
			, valuelabel angle(horizontal) labsize(*.9) glwidth(*0.75) glcolor(gs15) 
			)	
			xlabel(-.3(0.1).3, labsize(*.9))
			ytitle("")
			xtitle("Average marginal effect", size(*.9))
			graphregion(color(white) lcolor(white) lalign(outside) margin(t=25 b=20))
 			legend(	off	 
			)
		   ;
	#delimit cr		
	graph export "$path\figure_7.pdf", as(pdf) replace	
	
	*Restoring data
	restore	
	
	
********************************************************************************
*
* Survey design / summary statistics
*
********************************************************************************	
	
	****************************************************************************
	*Figure A.2.1. Age distribution of respondents
	****************************************************************************	
	
	*Preserving data
	preserve	
	
	*Number of respondents
	gen numb_respond=1 if age!=.	
	
	*Aggregating data 
	collapse (sum) numb_respond, by(age) 	
	
	*Graph
	#delimit ;
	twoway (bar numb_respond age, lcolor(gs5) color(gs10) barwidth(.6) )
		   ,
			ysize(1)
			xsize(1)			
			yscale(range() noextend titlegap(*+5))
			xscale(range(18 70) noextend titlegap(*+7))
			ylabel(				
			, angle(horizontal) nogrid)
			xlabel(20(10)70, labgap(*2.5)
			)	
			ytitle("Number of respondents")
			xtitle("Age")			
			graphregion(color(white) lcolor(white) lalign(outside)) 			
			legend(off)
		   ;
	#delimit cr			
	graph export "$path\figure_A_2_1.pdf", replace as(pdf)	
		
	*Restoring data
	restore		
	
	
	****************************************************************************
	*Figure A.2.2. Gender distribution of respondents
	****************************************************************************	

	*Preserving data
	preserve	
	
	*Number of respondents
	gen numb_respond=1 if gender!=.	
	
	*Aggregating data 
	collapse (sum) numb_respond, by(gender) 	
	
	*Graph
	#delimit ;
	twoway (bar numb_respond gender, lcolor(gs5) color(gs10) barwidth(.2) )
		   ,
			ysize(1)
			xsize(1)			
			yscale(range() noextend titlegap(*+5))
			xscale(range(.5 3.5) noextend titlegap(*+7))
			ylabel(				
			, angle(horizontal) nogrid)
			xlabel(1 "Male" 2 "Female" 3 "Diverse", labgap(*2.5)
			)	
			ytitle("Number of respondents")
			xtitle("Gender", color(white))			
			graphregion(color(white) lcolor(white) lalign(outside)) 			
			legend(off)
		   ;
	#delimit cr			
	graph export "$path\figure_A_2_2.pdf", replace as(pdf)	
		
	*Restoring data
	restore			
	
		
	****************************************************************************
	*Figure A.2.3. Education attainments of respondents
	****************************************************************************	

	*Preserving data
	preserve
	
	*Number of respondents
	gen numb_respond=1 if education!=.
	
	*Aggregating data 
	collapse (sum) numb_respond, by(education) 
		
	*Graph
	#delimit ;
	twoway (bar numb_respond education, lcolor(gs5) color(gs10) barwidth(.5))
		   ,
			ysize(1)
			xsize(1)			
			yscale(range() noextend titlegap(*+5))
			xscale(range(1 6) noextend titlegap(*+7))
			ylabel( , angle(horizontal) nogrid)
			xlabel(1(1)6
				, labgap(*2.5)
			)	
			ytitle("Number of respondents")
			xtitle("Educational attainment")			
			graphregion(color(white) lcolor(white) lalign(outside)) 			
			legend(off)
		   ;
	#delimit cr		
	graph export "$path\figure_A_2_3.pdf", replace as(pdf)	
	
	*Restoring data
	restore			
		
		
	****************************************************************************
	*Figure A.2.4. Geographic distribution of respondents
	****************************************************************************	

	*Preserving data
	preserve
	
	*Number of respondents
	gen numb_respond=1 if plz_num!=.
	
	*Aggregating data 
	collapse (sum) numb_respond, by(plz_num) 
		
	*Graph
	#delimit ;
	twoway (bar numb_respond plz_num, lcolor(gs5) color(gs10) base(-1) barwidth(.8) )
		   ,
			ysize(1)
			xsize(1)			
			yscale(range() noextend titlegap(*+5))
			xscale(range(0 9) noextend titlegap(*+7))
			ylabel(				
			, angle(horizontal) nogrid)
			xlabel(0(1)9 , labgap(*2.5)
			)	
			ytitle("Number of respondents")
			xtitle("Postal codes (first digit)")			
			graphregion(color(white) lcolor(white) lalign(outside)) 			
			legend(off)
		   ;
	#delimit cr		
	graph export "$path\figure_A_2_4.pdf", replace as(pdf)	
	
	*Restoring data
	restore
		
		
	****************************************************************************
	*Figure A.2.5. Time of survey engagement
	****************************************************************************	

	*Preserving data
	preserve 	
	
	*Generating variable for counting observations
	gen obs=1
		
	*Generating variable on total observations in each wave
	gen total_obs=_N
	
	*Collapsing data
	collapse (sum) obs (first) total_obs, by(start_hour)
	
	*Filling-in missing hours
	tsset start_hour
	tsfill, full
	replace obs=0 if obs==.
	replace total_obs=total_obs[_n-1] if total_obs==.
	
	*Calculating shares
	gen share=(obs/total_obs)*100
	
	*Graph
	#delimit ;
	twoway (bar share start_hour, lcolor(gs5) color(gs10) barwidth(.8) )
		   ,
			ysize(1)
			xsize(1.2)			
			yscale(range() noextend titlegap(*+5))
			xscale(range() noextend titlegap(*+7))
			ylabel(0(5)25				
			, angle(horizontal) nogrid)
			xlabel(0(2)24, labgap(*2.5)
			)	
			xtick(0(1)24)
			ytitle("Share of respondents (%)")
			xtitle("Hour of the day")						
			legend(off)
			graphregion(color(white) lcolor(white) lalign(outside))
		   ;
	#delimit cr		
	graph export "$path\figure_A_2_5.pdf", replace as(pdf)	
				
	*Restoring data
	restore	
	
		
	****************************************************************************
	*Figure A.2.6. Survey completion time 
	****************************************************************************	
	
	*Graph: Boxplots
	#delimit ;	
	violinplot duration, over(wave) 
						 vertical 
						 range(0 15)
						 line(lcolor(white))
						 whiskers(lcolor(black))
						 median(mfcolor(black) mlcolor(black))
						 box(recast(rbar) barwidth(0.2) fcolor(none) lcolor(black) lwidth(*0.85))
					   yscale(range() noextend titlegap(*+10))
					   xscale(range() noline titlegap(*+7))			   
					   ylabel(0(5)15, angle(horizontal) nogrid)
					   xlabel(0 `" "Before World Cup start" "(Wave 1)" "' 1 `" "After World Cup start" "(Wave 2)" "',)
					   ytick(0(1)15)
					   ytitle("Completion time (minutes)")
					   ysize(1.2)
					   xsize(1)
					   graphregion(color(white) lcolor(white) lalign(outside)) 
			   ;
	#delimit cr
	graph export "$path\figure_A_2_6.pdf", replace as(pdf)		
	
		
	****************************************************************************
	*Figure A.2.7. Balance test
	****************************************************************************
	
	*Preserving data
	preserve		
	
	*Centering variables: age
	center age, gen(age_center) standardize	
	
	#delimit ;
	tokenize 			   "	
						 age_center
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_arab
						 world_regions_russia
						 world_regions_us 
						 world_regions_asia 
						 world_regions_europe
						 " ;
						 
	forval j=1/14  { ;	

	reg ``j'' wave ;				 
	eststo robc4_`j' ;							 
	margins , dydx(wave) at((asobserved) _all) level(95) post ; 	
	parmest, saving("$path\results_fig_A_2_7_`j'_95CI.dta", replace) idstr(``j'') format(estimate min95 max95) ;	
			
	};
	#delimit cr		
	
	*Loading data
	use "$path\results_fig_A_2_7_1_95CI.dta", clear		
	
	forval j=2/14   {
			append using "$path\results_fig_A_2_7_`j'_95CI.dta"
    }	
		
	*Generating y-axis variable
	gen dv=.	
	replace dv=1 if idstr=="world_regions_russia"
	replace dv=2 if idstr=="world_regions_us"
	replace dv=3 if idstr=="world_regions_europe"
	replace dv=4 if idstr=="world_regions_asia"	
	replace dv=5 if idstr=="world_regions_arab"	
	replace dv=6 if idstr=="pol_left_right"
	replace dv=7 if idstr=="pol_interest"
	replace dv=8 if idstr=="education3"
	replace dv=9 if idstr=="age_center"
	replace dv=10 if idstr=="male"
	replace dv=11 if idstr=="mig_backg"
	replace dv=12 if idstr=="born_gdr"
	replace dv=13 if idstr=="football_reports"	
	replace dv=14 if idstr=="football_consumption"	
	
	sort dv
	
	*Generating value label
	#delimit ;
	label define vars  
			14 "Football interest"
			13 "Critical reports"
			12 "Born in GDR"
			11 "Migration background"
			10 "Male"
			9 "Age"
			8 "Education"
			7 "Political interest"
			6 "Conservatism"
			5 "Arab world affinity"
			4 "Asia affinity"
			3 "Western Europe affinity"
			2 "United States affinity"
			1 "Russia affinity"	
	;
	#delimit cr
	
	*Labeling variable for plotting
	label val dv vars
		
	*Graph
	#delimit ;
	twoway (rspike min95 max95 dv , horizontal lcolor(black))   
		   (scatter dv estimate , mcolor(black) )  		   
		   , 
			xline(0, lpattern(shortdash) lcolor(black) lwidth(*0.75)) 
			ysize(1)
			xsize(1.2)			
			yscale(range(.75 14.25) noextend titlegap(*+5))
			xscale(range() noextend titlegap(*+7))
			ylabel(1(1)14, valuelabel angle(horizontal) labsize(*.9) glwidth(*0.75) glcolor(gs15) 
			)	
			xlabel(-.3(.1).3, labsize(*.9))
			ytitle("")
			xtitle("Average marginal effect", size(*.9))
			graphregion(color(white) lcolor(white) lalign(outside))
 			legend( off	)
		   ;
	#delimit cr	
	graph export "$path\figure_A_2_7.pdf", as(pdf) replace	
	
	*Restoring data
	restore		
	
	
	****************************************************************************
	*Table A.4.1. Summary statistics
	****************************************************************************	
	
	#delimit ;
	sum 
		qatar_statements_1_influence 
		qatar_statements_1_aggro
		qatar_statements_1_tech
		qatar_statements_1_orga 
		qatar_statements_1_travel
		qat_state_2_worker
		qat_state_2_women
		qat_state_2_lgbt		
		
		world_regions_arab		
		world_regions_russia 
		world_regions_us 
		world_regions_asia 
		world_regions_europe		
			
		qat_state_2_speech
		qat_state_2_critic
		pol_media_opinion
		football_boycott_pol 	
		
		pol_woke_female
		pol_xeno_mosque
		pol_woke_homo
		pol_xeno_security		

		football_opening_cat
		football_german
		
		wave
		
		age
		male 
		education3 
		mig_backg 
		pol_interest 
		pol_left_right 
		football_consumption	
		football_reports
		born_gdr	
		
		monday 
		tuesday
		wednesday
		
		hour_first 
		hour_second 
		hour_third
		hour_fourth
		;
	#delimit cr	
	
	
	
********************************************************************************
*
* Main results / statistical analysis 
*
********************************************************************************


	****************************************************************************
	*Table A.5.1. Watching the start of the World Cup
	****************************************************************************
	
	*Control variables
	#delimit ;
	global controls_1 = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption	
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr

	*Model 1  
	reg football_opening_cat $controls_1 if wave==0, robust
	
	*Model 2  
	reg football_opening_cat $controls_1 if wave==1, robust
	
	
	****************************************************************************
	*Table A.5.2. World Cup start and change of opinions about Qatar
	****************************************************************************	

	*Control variables
	#delimit ;
	global controls_2 = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr
		
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qatar_statements_1_influence 
						   qatar_statements_1_aggro
						   qatar_statements_1_tech
						   qatar_statements_1_orga 
						   qatar_statements_1_travel
						   qat_state_2_worker
						   qat_state_2_women
						   qat_state_2_lgbt
						   ";
	#delimit cr	
	
	*Models 1-8
	forval j=1/8  {	
	tab ``j''
	
	reg ``j'' wave $controls_2 , robust
	eststo model_2_`j'_1	
	}			
	
	
	****************************************************************************
	*Table A.5.3. World Cup start and change of opinions about world regions and countries
	****************************************************************************		

	*Control variables
	#delimit ;
	global controls_3 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 "
	;
	#delimit cr	
			
	*Model 1
	reg world_regions_arab wave $controls_3 world_regions_russia world_regions_us world_regions_asia world_regions_europe , robust 
	
	*Model 2
	reg world_regions_asia wave $controls_3 world_regions_russia world_regions_arab world_regions_us world_regions_europe , robust 
		
	*Model 3
	reg world_regions_europe wave $controls_3 world_regions_russia world_regions_arab world_regions_asia world_regions_us , robust 
			
	*Model 4
	reg world_regions_us wave $controls_3 world_regions_russia world_regions_arab world_regions_asia world_regions_europe , robust 
			
	
	****************************************************************************
	*Table A.5.4. World Cup start and change of opinions about German media and boycott
	****************************************************************************		
	
	*Control variables
	#delimit ;
	global controls_4 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr	
							
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qat_state_2_speech
						   qat_state_2_critic
						   pol_media_opinion
						   football_boycott_pol 
						   ";
	#delimit cr	

	*Models 1-4
	forval j=1/4  {	
	tab ``j''
	
	reg ``j'' wave $controls_4 , robust
	eststo model_4_`j'_1	
		
	}		
	
		
	****************************************************************************
	*Table A.5.5. World Cup start and change of political opinions
	****************************************************************************		

	*Control variables
	#delimit ;
	global controls_5 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr	
	
	*Dependent variables
	#delimit ;
	tokenize 			   "	
						   pol_woke_female
						   pol_xeno_mosque
						   pol_woke_homo
						   pol_xeno_security
						   ";
	#delimit cr							   

	*Models 1-4
	forval j=1/4  {	
	tab ``j''
	
	reg ``j'' wave $controls_5 , robust					
	
	}		
	
	
	****************************************************************************
	*Figure A.5.1. Respondents who planned to watch / reportedly watched World Cup opener 
	****************************************************************************	
	
	*Preserving data
	preserve
	
	*Number of respondents
	gen numb_respond=1 if football_opening_cat!=.
	
	*Generating binary watching variable
	recode football_opening_cat (1 = 0) (2 3 = 1), gen(football_opening_bin)
	
	*Aggregating data 
	collapse (sum) football_opening_bin numb_respond, by(wave) 
	
	*Calculating share
	gen football_opening_share=(football_opening_bin / numb_respond)*100
	
	*Generating xaxis
	recode wave (0 = .5) (1 = 0), gen(xaxis)
	
	*Graph
	#delimit ;
	twoway (dropline football_opening_share xaxis if wave==0, horizontal mcolor(black) lcolor(black) lwidth(*0.5))
		   (dropline football_opening_share xaxis if wave==1, horizontal mcolor(black) lcolor(black) lwidth(*0.5))
		   ,
			ysize(1)
			xsize(1.2)			
			yscale(range(-.2 1.1) noline titlegap(*+5))
			xscale(range(0 50) noextend titlegap(*+7))
			ylabel(.5 `" "Planned to watch" " " "(Wave 1) " "' 
					0 `" "Reportedly watched" " " "(Wave 2) " "', notick angle(horizontal) nogrid)
			xlabel(0(10)50)
			ytick(, tlength(*0.5))			
			ytitle("")
			xtitle("Respondents (in %)")			
			graphregion(color(white) lcolor(white) lalign(outside)  margin(t=15 b=15)) 			
			legend(off)
		   ;
	#delimit cr		
	graph export "$path\figure_A_5_1.pdf", replace as(pdf)	
	
	*Restoring data
	restore		
	
	
	****************************************************************************
	*Figure A.5.2. Marginal effects of factors influencing people's decision to watch the World Cup opener
	****************************************************************************	
	
	*Preserving data
	preserve
	
	*Control variables
	#delimit ;
	global controls_1 = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption	
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr
	
	*Model 1
	reg football_opening_cat $controls_1 if wave==0, robust
	eststo model_1_1_1
	margins , dydx(*) at((asobserved) _all) level(95) post 	
	parmest, saving("$path\result_fig_A_5_2_1_95CI.dta", replace) idstr(model_1_1_1) format(estimate min95 max95)	
	
	*Model 2  
	reg football_opening_cat $controls_1 if wave==1, robust
	eststo model_1_1_2
	margins , dydx(*) at((asobserved) _all) level(95) post 	
	parmest, saving("$path\result_fig_A_5_2_2_95CI.dta", replace) idstr(model_1_1_2) format(estimate min95 max95)		
	
	*Loading data
	use "$path\result_fig_A_5_2_1_95CI.dta", clear		
	append using "$path\result_fig_A_5_2_2_95CI.dta"
    		
	*Extracting model type
	gen type=regexs(0)	if regexm(idstr,"[0-9]$")
	
	*Destringing variables
	destring type, replace
	
	*Generating y-axis variable
	gen dv=.	
	replace dv=1 if parm=="world_regions_russia"
	replace dv=2 if parm=="pol_left_right"
	replace dv=3 if parm=="pol_interest"
	replace dv=4 if parm=="education3"
	replace dv=5 if parm=="age"
	replace dv=6 if parm=="male"
	replace dv=7 if parm=="mig_backg"
	replace dv=8 if parm=="born_gdr"
	replace dv=9 if parm=="football_reports"	
	replace dv=10 if parm=="football_consumption"	
	
	sort dv type
	gen yaxis=dv
	replace yaxis=yaxis+.2 if type==1
	replace yaxis=yaxis-.2 if type==2
	
	*Graph
	#delimit ;
	twoway (rspike min95 max95 yaxis if type==1 & (dv==10 | dv==7 | dv==4 | dv==3), horizontal lcolor(black))
		   (rspike min95 max95 yaxis if type==2 & (dv==10 | dv==3 | dv==1), horizontal lcolor(black))
		   (rspike min95 max95 yaxis if type==1 & (dv==9 | dv==8 | dv==6 | dv==5 | dv==2 | dv==1), horizontal lcolor(gs10))
		   (rspike min95 max95 yaxis if type==2 & (dv==9 | dv==8 | dv==7 | dv==6 | dv==5 | dv==4 | dv==2), horizontal lcolor(gs10))		   
		   (scatter yaxis estimate if type==1 & (dv==10 | dv==7 | dv==4 | dv==3), mcolor(black) )  
		   (scatter yaxis estimate if type==2 & (dv==10 | dv==3 | dv==1), mfcolor(white) mlcolor(black) msize(*1.1))
		   (scatter yaxis estimate if type==1 & (dv==9 | dv==8 | dv==6 | dv==5 | dv==2 | dv==1), mcolor(gs10))
		   (scatter yaxis estimate if type==2 & (dv==9 | dv==8 | dv==7 | dv==6 | dv==5 | dv==4 | dv==2), mfcolor(white) mlcolor(gs10) msize(*1.1))	 		   
		   , 
			xline(0, lpattern(shortdash) lcolor(black) lwidth(*0.75)) 
			ysize(1)
			xsize(1.2)			
			yscale(range(.75 10.25) noextend titlegap(*+5))
			xscale(range(-.35 .35) noextend titlegap(*+7))
			ylabel(
			10 "Football interest"
			9 "Critical reports"
			8 "Born in GDR"
			7 "Migration background"
			6 "Male"
			5 "Age"
			4 "Education"
			3 "Political interest"
			2 "Conservatism"
			1 "Russia affinity"
			, valuelabel angle(horizontal) labsize(*.9) glwidth(*0.75) glcolor(gs15) 
			)	
			xlabel(-.3(0.1).3, labsize(*.9))
			ytitle("")
			xtitle("Average marginal effect", size(*.9))
			graphregion(color(white) lcolor(white) lalign(outside))
 			legend(		
					 position(6)
					 bmargin(0 0 0 2)
					 //ring(5)
					 row(2)
					 order(5 "Planned to watch (Wave 1)" 6 "Reportedly watched (Wave 2)" )
					 size(*.8) keygap(*0.75) symxsize(*0.5) symysize(*0.5)		 
			)
		   ;
	#delimit cr	
	graph export "$path\figure_A_5_2.pdf", as(pdf) replace	
	
	*Restoring data
	restore
	
	
********************************************************************************
*
* Robustness tests
*
********************************************************************************	
	
	****************************************************************************
	*Variables for robustness checks
	****************************************************************************	
	
	*Descriptives on survey
	tab wave
    sum duration_min,d
	bys wave: sum duration_min, d
	
	*Identifying super fast (min<2, top 5%) and slow respondents (min>20, bottom 5%)
	gen resond_slowfast=1 if duration_min<2 | duration_min>20 
	
	*Identifying respondents completing survey during German match
	gen respond_germmatch=1 if end_german > tc(23Nov2022 14:00:00) 	
	
	*Number of respondents dropped from analysis
	count if resond_slowfast==1		// 179
	count if respond_germmatch==1	// 19 	
		
	
	
	****************************************************************************
	*Table A.6.1. Watching the German team play
	****************************************************************************		

	*Control variables
	#delimit ;
	global controls_1 = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption	
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr		
		

	*Model 1
	reg football_german $controls_1 if wave==0, robust
				
	*Model 2
	reg football_german $controls_1 if wave==1, robust
	
	
	****************************************************************************
	*Table A.6.2. World Cup start and change of opinions about Qatar with control for opening ceremony
	****************************************************************************		
	
	#delimit ;
	global controls_2_ext = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 football_opening_cat
						 "
	;
	#delimit cr	
		
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qatar_statements_1_influence 
						   qatar_statements_1_aggro
						   qatar_statements_1_tech
						   qatar_statements_1_orga 
						   qatar_statements_1_travel
						   qat_state_2_worker
						   qat_state_2_women
						   qat_state_2_lgbt				  
						   ";
	#delimit cr		
	
	
	*Models 1-8
	forval j=1/8  {	
	tab ``j''

	reg ``j'' wave $controls_2_ext , robust

	}		
	
	
	****************************************************************************
	*Table A.6.3. World Cup start and change of opinions about world regions and countries with control for opening ceremony
	****************************************************************************

	#delimit ;
	global controls_3_ext = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 football_opening_cat
						 "
	;
	#delimit cr		
	
	*Model 1
	reg world_regions_arab wave $controls_3_ext world_regions_russia world_regions_us world_regions_asia world_regions_europe , robust 	
	
	*Model 2
	reg world_regions_asia wave $controls_3_ext   world_regions_russia world_regions_arab world_regions_us world_regions_europe , robust 			
	
	*Model 3
	reg world_regions_europe wave $controls_3_ext world_regions_russia world_regions_arab world_regions_asia world_regions_us , robust	
	
	*Model 4	
	reg world_regions_us wave $controls_3_ext world_regions_russia world_regions_arab world_regions_asia world_regions_europe , robust 	
	
		
	****************************************************************************
	*Table A.6.4. World Cup start and change of opinions about German media and boycott with control for opening ceremony
	****************************************************************************	

	*Control variables
	#delimit ;
	global controls_4_ext = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 football_opening_cat
						 "
	;
	#delimit cr	
		
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qat_state_2_speech
						   qat_state_2_critic
						   pol_media_opinion
						   football_boycott_pol 
						   ";
	#delimit cr	

	*Models 1-4
	forval j=1/4  {	
	tab ``j''
	
	reg ``j'' wave $controls_4_ext , robust
	}	
	
	
	****************************************************************************
	*Table A.6.5. World Cup start and change of political opinions with control for opening ceremony
	****************************************************************************
			
	*Control variables	
	#delimit ;
	global controls_5_ext = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 football_opening_cat
						 "
	;
	#delimit cr		
	
	*Dependent variables
	#delimit ;
	tokenize 			   "	
						   pol_woke_female
						   pol_xeno_mosque
						   pol_woke_homo
						   pol_xeno_security	
						   ";
	#delimit cr							   

	*Models 1-4
	forval j=1/4  {	
	tab ``j''

	reg ``j'' wave $controls_5_ext , robust
	
	}	
	
	
	****************************************************************************
	*Table A.6.6. Ordered logistic regressions: Watching the start of the World Cup
	****************************************************************************	
		
	*Control variables
	#delimit ;
	global controls_1 = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption	
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr

	*Model 1  
	ologit football_opening_cat $controls_1 if wave==0, robust
		
	*Model 2  
	ologit football_opening_cat $controls_1 if wave==1, robust
	
	
	****************************************************************************
	*Table A.6.7. Ordered logistic regressions: World Cup start and change of opinions about Qatar
	****************************************************************************	
	
	*Control variables
	#delimit ;
	global controls_2 = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr
		
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qatar_statements_1_influence 
						   qatar_statements_1_aggro
						   qatar_statements_1_tech
						   qatar_statements_1_orga 
						   qatar_statements_1_travel
						   qat_state_2_worker
						   qat_state_2_women
						   qat_state_2_lgbt
						   ";
	#delimit cr	
	
	*Models 1-8
	forval j=1/8  {	
	tab ``j''
	
	ologit ``j'' wave $controls_2 , robust
		
	}		
	
	
	****************************************************************************
	*Table A.6.8. Ordered logistic regressions: World Cup start and change of opinions about world regions and countries
	****************************************************************************	
	
				
	*Control variables
	#delimit ;
	global controls_3 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 "
	;
	#delimit cr	
			
	*Model 1
	ologit world_regions_arab wave $controls_3 world_regions_russia world_regions_us world_regions_asia world_regions_europe , robust 
		
	*Model 2
	ologit world_regions_asia wave $controls_3 world_regions_russia world_regions_arab world_regions_us world_regions_europe , robust 
		
	*Model 3
	ologit world_regions_europe wave $controls_3 world_regions_russia world_regions_arab world_regions_asia world_regions_us , robust 
	
	*Model 4
	ologit world_regions_us wave $controls_3 world_regions_russia world_regions_arab world_regions_asia world_regions_europe , robust 
	
	
	****************************************************************************
	*Table A.6.9. Ordered logistic regressions: World Cup start and change of opinions about German media and boycott
	****************************************************************************	
	
	*Control variables
	#delimit ;
	global controls_4 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr	
							
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qat_state_2_speech
						   qat_state_2_critic
						   pol_media_opinion
						   football_boycott_pol 
						   ";
	#delimit cr	

	*Models 1-4
	forval j=1/4  {	
	tab ``j''
	
	ologit ``j'' wave $controls_4 , robust
		
	}		
	

	****************************************************************************
	*Table A.6.10. Ordered logistic regressions: World Cup start and change of political opinions
	****************************************************************************	
		
	*Control variables
	#delimit ;
	global controls_5 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr	
	
	*Dependent variables
	#delimit ;
	tokenize 			   "	
						   pol_woke_female
						   pol_xeno_mosque
						   pol_woke_homo
						   pol_xeno_security
						   ";
	#delimit cr							   

	*Models 1-4
	forval j=1/4  {	
	tab ``j''
	
	ologit ``j'' wave $controls_5 , robust
	
	}		
	
	
	****************************************************************************
	*Table A.6.11. Clustered standard errors: Watching the start of the World Cup
	****************************************************************************	
	
	*Control variables
	#delimit ;
	global controls_1 = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption	
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr

	*Model 1 
	reg football_opening_cat $controls_1 if wave==0 , cluster(plz_num) 
		
	*Model 2  
	reg football_opening_cat $controls_1 if wave==1 , cluster(plz_num) 

	
	****************************************************************************
	*Table A.6.12. Clustered standard errors: World Cup start and change of opinions about Qatar with control for opening ceremony
	****************************************************************************	
	
	*Control variables
	#delimit ;
	global controls_2 = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr
		
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qatar_statements_1_influence 
						   qatar_statements_1_aggro
						   qatar_statements_1_tech
						   qatar_statements_1_orga 
						   qatar_statements_1_travel
						   qat_state_2_worker
						   qat_state_2_women
						   qat_state_2_lgbt
						   ";
	#delimit cr	
	
	*Models 1-8
	forval j=1/8  {	
	
	reg ``j'' wave $controls_2 , cluster(plz_num) 			
	}		
	
	
	****************************************************************************
	*Table A.6.13. Clustered standard errors: World Cup start and change of opinions about world regions and countries with control for opening ceremony
	****************************************************************************	
		*Control variables
	#delimit ;
	global controls_3 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 "
	;
	#delimit cr	
			
	*Model 1
	reg world_regions_arab wave $controls_3 world_regions_russia world_regions_us world_regions_asia world_regions_europe , cluster(plz_num) 
	
	*Model 2
	reg world_regions_asia wave $controls_3 world_regions_russia world_regions_arab world_regions_us world_regions_europe , cluster(plz_num) 
		
	*Model 3
	reg world_regions_europe wave $controls_3 world_regions_russia world_regions_arab world_regions_asia world_regions_us , cluster(plz_num) 
	
	*Model 4
	reg world_regions_us wave $controls_3 world_regions_russia world_regions_arab world_regions_asia world_regions_europe , cluster(plz_num) 
		
	
	****************************************************************************
	*Table A.6.14. Clustered standard errors: World Cup start and change of opinions about German media and boycott with control for opening ceremony
	****************************************************************************	
	
	*Control variables
	#delimit ;
	global controls_4 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr	
							
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qat_state_2_speech
						   qat_state_2_critic
						   pol_media_opinion
						   football_boycott_pol 
						   ";
	#delimit cr	

	*Models 1-4
	forval j=1/4  {	
	
	reg ``j'' wave $controls_4 , cluster(plz_num)
		
	}
	
	
	****************************************************************************
	*Table A.6.15. Clustered standard errors: World Cup start and change of political opinions with control for opening ceremony
	****************************************************************************	
		
	*Control variables
	#delimit ;
	global controls_5 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr	
	
	*Dependent variables
	#delimit ;
	tokenize 			   "	
						   pol_woke_female
						   pol_xeno_mosque
						   pol_woke_homo
						   pol_xeno_security
						   ";
	#delimit cr							   

	*Models 1-4
	forval j=1/4  {	
	
	reg ``j'' wave $controls_5 , cluster(plz_num)
		
	}	
	
	
	****************************************************************************
	*Table A.6.16. Reduced sample: Watching the start of the World Cup
	****************************************************************************	
		
	*Control variables
	#delimit ;
	global controls_1 = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption	
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr

	*Model 1  
	reg football_opening_cat $controls_1 if wave==0 & resond_slowfast!=1, robust
		
	*Model 2 
	reg football_opening_cat $controls_1 if wave==1 & resond_slowfast!=1, robust
	
	*Model 3 
	reg football_opening_cat $controls_1 if wave==0 & respond_germmatch!=1, robust
	
	*Model 4  
	reg football_opening_cat $controls_1 if wave==1 &respond_germmatch!=1, robust

	
	****************************************************************************
	*Table A.6.17. Reduced sample: World Cup start and change of opinions about Qatar
	****************************************************************************	
	
	*Control variables
	#delimit ;
	global controls_2 = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr
		
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qatar_statements_1_influence 
						   qatar_statements_1_aggro
						   qatar_statements_1_tech
						   qatar_statements_1_orga 
						   qatar_statements_1_travel
						   qat_state_2_worker
						   qat_state_2_women
						   qat_state_2_lgbt
						   ";
	#delimit cr	
	
	*Models 1-8
	forval j=1/8  {	

	reg ``j'' wave $controls_2 if resond_slowfast!=1, robust	
	
	}
	
	
	****************************************************************************
	*Table A.6.18. Reduced sample: World Cup start and change of opinions about Qatar
	****************************************************************************	

	
	*Control variables
	#delimit ;
	global controls_2 = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr
		
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qatar_statements_1_influence 
						   qatar_statements_1_aggro
						   qatar_statements_1_tech
						   qatar_statements_1_orga 
						   qatar_statements_1_travel
						   qat_state_2_worker
						   qat_state_2_women
						   qat_state_2_lgbt
						   ";
	#delimit cr	
	
	*Models 1-8
	forval j=1/8  {	

	reg ``j'' wave $controls_2 if respond_germmatch!=1, robust
		
	}	
	
	
	****************************************************************************
	*Table A.6.19. Reduced sample: World Cup start and change of opinions about world regions and countries
	****************************************************************************	
	
	*Control variables
	#delimit ;
	global controls_3 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 "
	;
	#delimit cr	
			
	*Model 1
	reg world_regions_arab wave $controls_3 world_regions_russia world_regions_us world_regions_asia world_regions_europe if resond_slowfast!=1, robust 
	
	*Model 2
	reg world_regions_asia wave $controls_3 world_regions_russia world_regions_arab world_regions_us world_regions_europe if resond_slowfast!=1, robust 

	*Model 3
	reg world_regions_europe wave $controls_3 world_regions_russia world_regions_arab world_regions_asia world_regions_us if resond_slowfast!=1, robust 
	
	*Model 4
	reg world_regions_us wave $controls_3 world_regions_russia world_regions_arab world_regions_asia world_regions_europe if resond_slowfast!=1, robust 
			
	*Model 5
	reg world_regions_arab wave $controls_3 world_regions_russia world_regions_us world_regions_asia world_regions_europe if respond_germmatch!=1, robust 
	
	*Model 6
	reg world_regions_asia wave $controls_3 world_regions_russia world_regions_arab world_regions_us world_regions_europe if respond_germmatch!=1, robust 

	*Model 7
	reg world_regions_europe wave $controls_3 world_regions_russia world_regions_arab world_regions_asia world_regions_us if respond_germmatch!=1, robust 
	
	*Model 8
	reg world_regions_us wave $controls_3 world_regions_russia world_regions_arab world_regions_asia world_regions_europe if respond_germmatch!=1, robust 
			
	
	****************************************************************************
	*Table A.6.20. Reduced sample: World Cup start and change of opinions about German media and boycott
	****************************************************************************	

	*Control variables
	#delimit ;
	global controls_4 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr	
							
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qat_state_2_speech
						   qat_state_2_critic
						   pol_media_opinion
						   football_boycott_pol 
						   ";
	#delimit cr	

	*Models 1-8
	forval j=1/4  {	

	reg ``j'' wave $controls_4  if resond_slowfast!=1, robust
	
	reg ``j'' wave $controls_4 if respond_germmatch!=1, robust	
	
	}		
	
	
	****************************************************************************
	*Table A.6.21. Reduced sample: World Cup start and change of political opinions
	****************************************************************************	

	*Control variables
	#delimit ;
	global controls_5 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr	
	
	*Dependent variables
	#delimit ;
	tokenize 			   "	
						   pol_woke_female
						   pol_xeno_mosque
						   pol_woke_homo
						   pol_xeno_security
						   ";
	#delimit cr							   

	*Models 1-8
	forval j=1/4  {	

	reg ``j'' wave $controls_5 if resond_slowfast!=1, robust
	
	reg ``j'' wave $controls_5 if respond_germmatch!=1, robust
		
	}			
	
	****************************************************************************
	*Table A.6.22. Watching the start of the World Cup with controls for week days (Reference category: Wednesdays)
	****************************************************************************	
	
	*Control variables
	#delimit ;
	global controls_1 = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption	
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr
	
	*Model 1 
	reg football_opening_cat $controls_1 monday tuesday if wave==0 , robust 
		
	*Model 2
	reg football_opening_cat $controls_1 monday tuesday if wave==1 , robust 
	
	
	****************************************************************************
	*Table A.6.23. World Cup start and change of opinions about Qatar with controls for week days (Reference category: Wednesdays)
	****************************************************************************	
	
	*Control variables
	#delimit ;
	global controls_2 = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr
		
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qatar_statements_1_influence 
						   qatar_statements_1_aggro
						   qatar_statements_1_tech
						   qatar_statements_1_orga 
						   qatar_statements_1_travel
						   qat_state_2_worker
						   qat_state_2_women
						   qat_state_2_lgbt
						   ";
	#delimit cr	
	
	*Models 1-8
	forval j=1/8  {	
	
	reg ``j'' wave $controls_2 monday tuesday , robust 
				
	}		
	
	
	****************************************************************************
	*Table A.6.24. World Cup start and change of opinions about world regions and countries with controls for week days (Reference category: Wednesdays)
	****************************************************************************	
	
	*Control variables
	#delimit ;
	global controls_3 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 "
	;
	#delimit cr	
			
	*Model 1
	reg world_regions_arab wave $controls_3 world_regions_russia world_regions_us world_regions_asia world_regions_europe monday tuesday , robust
	
	*Model 2
	reg world_regions_asia wave $controls_3 world_regions_russia world_regions_arab world_regions_us world_regions_europe monday tuesday , robust 
		
	*Model 3
	reg world_regions_europe wave $controls_3 world_regions_russia world_regions_arab world_regions_asia world_regions_us monday tuesday , robust 
		
	*Model 4
	reg world_regions_us wave $controls_3 world_regions_russia world_regions_arab world_regions_asia world_regions_europe monday tuesday , robust 
		
	
	****************************************************************************
	*Table A.6.25. World Cup start and change of opinions about German media and boycott with controls for week days (Reference category: Wednesdays)
	****************************************************************************	

	*Control variables
	#delimit ;
	global controls_4 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr	
							
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qat_state_2_speech
						   qat_state_2_critic
						   pol_media_opinion
						   football_boycott_pol 
						   ";
	#delimit cr	

	*Models 1-4
	forval j=1/4  {	
	
	reg ``j'' wave $controls_4 monday tuesday, robust
		
	}	
	
	
	****************************************************************************
	*Table A.6.26. Clustered standard errors: World Cup start and change of political opinions with controls for week days (Reference category: Wednesdays)
	****************************************************************************	

	*Control variables
	#delimit ;
	global controls_5 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr	
	
	*Dependent variables
	#delimit ;
	tokenize 			   "	
						   pol_woke_female
						   pol_xeno_mosque
						   pol_woke_homo
						   pol_xeno_security
						   ";
	#delimit cr							   

	*Models 1-4
	forval j=1/4  {	
	
	reg ``j'' wave $controls_5 monday tuesday, robust
	
	}		
	
	
	****************************************************************************
	*Table A.6.27. Watching the start of the World Cup with controls for daytime (Reference category: Hours 18:00-24:00)
	****************************************************************************	
	
	*Control variables
	#delimit ;
	global controls_1 = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption	
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr

	
	*Model 1 
	reg football_opening_cat $controls_1 hour_first hour_second hour_third if wave==0 , robust 
		
	*Model 2
	reg football_opening_cat $controls_1 hour_first hour_second hour_third if wave==1 , robust 
	
	
	****************************************************************************
	*Table A.6.28. World Cup start and change of opinions about Qatar with controls for daytime (Reference category: Hours 18:00-24:00)
	****************************************************************************	
	
	*Control variables
	#delimit ;
	global controls_2 = "
						 age
						 male 
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr
		
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qatar_statements_1_influence 
						   qatar_statements_1_aggro
						   qatar_statements_1_tech
						   qatar_statements_1_orga 
						   qatar_statements_1_travel
						   qat_state_2_worker
						   qat_state_2_women
						   qat_state_2_lgbt
						   ";
	#delimit cr	
	
	*Models 1-8
	forval j=1/8  {	
	
	reg ``j'' wave $controls_2 hour_first hour_second hour_third , robust 
				
	}	
		
	
	****************************************************************************
	*Table A.6.29. World Cup start and change of opinions about world regions and countries with controls for daytime (Reference category: Hours 18:00-24:00)
	****************************************************************************	

	*Control variables
	#delimit ;
	global controls_3 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 "
	;
	#delimit cr	
			
	*Model 1
	reg world_regions_arab wave $controls_3 world_regions_russia world_regions_us world_regions_asia world_regions_europe hour_first hour_second hour_third , robust
	
	*Model 2
	reg world_regions_asia wave $controls_3 world_regions_russia world_regions_arab world_regions_us world_regions_europe hour_first hour_second hour_third , robust 
			
	*Model 3
	reg world_regions_europe wave $controls_3 world_regions_russia world_regions_arab world_regions_asia world_regions_us hour_first hour_second hour_third , robust 
	
	*Model 4
	reg world_regions_us wave $controls_3 world_regions_russia world_regions_arab world_regions_asia world_regions_europe hour_first hour_second hour_third , robust 
			
	
	****************************************************************************
	*Table A.6.30. World Cup start and change of opinions about German media and boycott with controls for daytime (Reference category: Hours 18:00-24:00)
	****************************************************************************	
	
	*Control variables
	#delimit ;
	global controls_4 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr	
							
	*Dependent variables
	#delimit ;
	tokenize 			   "
						   qat_state_2_speech
						   qat_state_2_critic
						   pol_media_opinion
						   football_boycott_pol 
						   ";
	#delimit cr	

	*Models 1-4
	forval j=1/4  {	
	
	reg ``j'' wave $controls_4 hour_first hour_second hour_third, robust	
		
	}	
	
	
	****************************************************************************
	*Table A.6.31. Clustered standard errors: World Cup start and change of political opinions with controls for daytime (Reference category: Hours 18:00-24:00)
	****************************************************************************	
	
	*Control variables
	#delimit ;
	global controls_5 = "
						 age
						 male
						 education3 
						 mig_backg 
						 pol_interest 
						 pol_left_right 
						 football_consumption 
						 football_reports
						 born_gdr
						 world_regions_russia
						 "
	;
	#delimit cr	
	
	*Dependent variables
	#delimit ;
	tokenize 			   "	
						   pol_woke_female
						   pol_xeno_mosque
						   pol_woke_homo
						   pol_xeno_security
						   ";
	#delimit cr							   

	*Models 1-4
	forval j=1/4  {	
	
	reg ``j'' wave $controls_5 hour_first hour_second hour_third, robust
	
	}	
		
		
		
********************************************************************************
*
*  Plausibility checks
*
********************************************************************************			
		

	****************************************************************************
	*Figure A.7.1. Patterns in google search terms
	****************************************************************************		
			
	*Loading dataset
	use "$path\searchterm_data.dta", clear
	

 	********************************
	* Preparing data
 	********************************
	
	*Generation variables for shading World Cup days
	gen low=-1
	gen high=105
	
	*Generating variable to highlight day of World Cup opening
	gen xaxis=.
	replace xaxis=day if day==20
	

 	********************************	
	* Panel (a)
 	********************************	
	
	*Graph: Football world cup
	#delimit ;
	twoway 
			(rarea high low day if day>=19.5, color(gs14%100) lwidth(0))
			(rspike high low xaxis, color(black) lpattern(shortdash) lwidth(*.5))			
			(connected trendscore day if id==3, msize(*1.25) mcolor(black) lcolor(black) lpattern(solid))
		   ,
			ysize(1)
			xsize(1.5)			
			yscale(range() noextend titlegap(*+5))
			xscale(range() noextend titlegap(*+7) lcolor(white))
			ylabel(0(20)100, angle(horizontal) nogrid labsize(*1.2))
			xlabel(14(1)23, labgap(*2.5) labsize(*1.2) labcolor(white) tlcolor(white))
			ytitle("Football World Cup", size(*1.2))
			xtitle("Day", size(*1.2) color(white))			
			graphregion(color(white) lcolor(white) lalign(outside))
			legend(off)
			name(worldcup, replace)
		   ;
	#delimit cr		
			
	*Graph: Qatar
	#delimit ;
	twoway 
			(rarea high low day if day>=19.5, color(gs14%100) lwidth(0))
			(rspike high low xaxis, color(black) lpattern(shortdash) lwidth(*.5))			
			(connected trendscore day if id==5, msize(*1.25) mcolor(black) lcolor(black) lpattern(solid))
		   ,
			ysize(1)
			xsize(1.5)			
			yscale(range() noextend titlegap(*+5))
			xscale(range() noextend titlegap(*+7) lcolor(white))
			ylabel(0(20)100, angle(horizontal) nogrid labsize(*1.2))
			xlabel(14(1)23, labgap(*2.5) labsize(*1.2) labcolor(white) tlcolor(white) )	
			ytitle("Qatar", size(*1.2))
			xtitle("Day", size(*1.2)  color(white))			
			graphregion(color(white) lcolor(white) lalign(outside))
			legend(off)
			name(qatar, replace)
		   ;
	#delimit cr		
	
	*Graph: Opening ceremony	
	#delimit ;
	twoway 
			(rarea high low day if day>=19.5, color(gs14%100) lwidth(0))
			(rspike high low xaxis, color(black) lpattern(shortdash) lwidth(*.5))			
			(connected trendscore day if id==2, msize(*1.25) mcolor(black) lcolor(black) lpattern(solid))
		   ,
			ysize(1)
			xsize(1.5)			
			yscale(range() noextend titlegap(*+5))
			xscale(range() noextend titlegap(*+7))
			ylabel(0(20)100, angle(horizontal) nogrid labsize(*1.2))
			xlabel(14(1)23, labgap(*2.5) labsize(*1.2))	
			ytitle("Opening ceremony + ZDF", size(*1.2))
			xtitle("Day", size(*1.2))			
			graphregion(color(white) lcolor(white) lalign(outside))
			legend(off)
			name(openingzdf, replace)
		   ;
	#delimit cr			
		
	*Combining graphs
	#delimit ;
	graph combine worldcup qatar openingzdf
		  , 
		  ysize(1.5) 
		  xsize(1) 
		  row(3) 
		  imargin(l=0 r=0 b=-7 t=0)
		  graphregion(color(white) lcolor(white) lalign(outside))
	;	
	#delimit cr	
	graph export "$path/figure_A_7_1_a.pdf", replace as(pdf)		
	
	
 	********************************	
	* Panel (b)
 	********************************	
	
	*Graph: Hypocrisy	
	#delimit ;
	twoway 
			(rarea high low day if day>=19.5, color(gs14%100) lwidth(0))
			(rspike high low xaxis, color(black) lpattern(shortdash) lwidth(*.5))			
			(connected trendscore day if id==4, msize(*1.25) mcolor(black) lcolor(black) lpattern(solid))
		   ,
			ysize(1)
			xsize(1.5)			
			yscale(range() noextend titlegap(*+5))
			xscale(range() noextend titlegap(*+7) lcolor(white))
			ylabel(0(20)100, angle(horizontal) nogrid labsize(*1.2))
			xlabel(14(1)23, labgap(*2.5) labsize(*1.2) labcolor(white) tlcolor(white))	
			ytitle("Hypocrisy", size(*1.2))
			xtitle("Day", size(*1.2) color(white))			
			graphregion(color(white) lcolor(white) lalign(outside))
			legend(off)
			name(hypocrisy, replace)
		   ;
	#delimit cr		
	
	*Graph: One-sided reporting	
	#delimit ;
	twoway 
			(rarea high low day if day>=19.5, color(gs14%100) lwidth(0))
			(rspike high low xaxis, color(black) lpattern(shortdash) lwidth(*.5))			
			(connected trendscore day if id==1, msize(*1.25) mcolor(black) lcolor(black) lpattern(solid))
		   ,
			ysize(1)
			xsize(1.5)			
			yscale(range() noextend titlegap(*+5))
			xscale(range() noextend titlegap(*+7) lcolor(white))
			ylabel(0(20)100, angle(horizontal) nogrid labsize(*1.2))
			xlabel(14(1)23, labgap(*2.5) labsize(*1.2) labcolor(white) tlcolor(white))
			ytitle("One-sided reporting", size(*1.2))
			xtitle("Day", size(*1.2) color(white))			
			graphregion(color(white) lcolor(white) lalign(outside))
			legend(off)
			name(onesidereporting, replace)
		   ;
	#delimit cr		
			
	*Graph: Lying press
	#delimit ;
	twoway 
			(rarea high low day if day>=19.5, color(gs14%100) lwidth(0))
			(rspike high low xaxis, color(black) lpattern(shortdash) lwidth(*.5))			
			(connected trendscore day if id==7, msize(*1.25) mcolor(black) lcolor(black) lpattern(solid))
		   ,
			ysize(1)
			xsize(1.5)			
			yscale(range() noextend titlegap(*+5))
			xscale(range() noextend titlegap(*+7))
			ylabel(0(20)100, angle(horizontal) nogrid labsize(*1.2))
			xlabel(14(1)23, labgap(*2.5) labsize(*1.2))	
			ytitle("Lying press", size(*1.2))
			xtitle("Day", size(*1.2))			
			graphregion(color(white) lcolor(white) lalign(outside))
			legend(off)
			name(lyingpress, replace)
		   ;
	#delimit cr		
		
	*Combining graphs
	#delimit ;
	graph combine hypocrisy onesidereporting lyingpress
		  , 
		  ysize(1.5) 
		  xsize(1) 
		  row(3) 
		  imargin(l=0 r=0 b=-7 t=0)
		  graphregion(color(white) lcolor(white) lalign(outside))
	;	
	#delimit cr	
	graph export "$path/figure_A_7_1_b.pdf", replace as(pdf)
	

	****************************************************************************
	*Figure A.7.2. Twitter replies in response to broadcast announcement by German TV (ZDF) on day of World Cup start
	****************************************************************************			
				
	*Loading dataset
	use "$path\tweets_data.dta", clear
		
	*Extracting date and time information
	gen day=substr(date,4,2)
	gen month=substr(date,1,2)
	gen year=substr(date,7,4)
	gen hour=substr(time,1,2)
	gen minute=substr(time,4,2)	
	destring month day year hour minute, replace
	
	*Generating Stata-compatible timestamp variable
	gen double date_tweet = mdyhms(month, day, year, hour, minute, 0)
	format date_tweet %tc		
	
	*Identifying pre- and post-opening ceremony coverage
	gen post_ceremony=0 if date_tweet<tc(20nov2022 15:30:00)
	replace post_ceremony=1 if date_tweet>=tc(20nov2022 15:30:00)
	
	*Calculating shares of twitter response types
	gen total_tweets=1 if sentiment!=.
	gen anti_wc=1 if sentiment==0
	gen neutral=1 if sentiment==1
	gen anti_media=1 if sentiment==2
	
	collapse (sum) anti_wc neutral anti_media total_tweets, by(post_ceremony) 
	
	foreach var of varlist anti_wc neutral anti_media {
		gen share_`var'=(`var'/total_tweets)*100	
	}
	
	*Graph
	#delimit ;
	twoway	(connected share_anti_wc post_ceremony, lpattern(shortdash) lcolor(black) mlcolor(black) mfcolor(white) msize(*1.3))
			(connected share_neutral post_ceremony, lpattern(shortdash) lcolor(gs10) mlcolor(gs10) mfcolor(white) msize(*1.3))
			(connected share_anti_media post_ceremony, lcolor(black) mcolor(black) msize(*1.3))
			,
			ysize(1)
			xsize(1.4)	
			yscale(range(0 100) noextend titlegap(+2)) 
			xscale(range(-.25 1.95) noextend)					
			xtitle("")
			ytitle("Share of tweets (%)")
			ylabel(0(20)100, nogrid angle(horizontal))
			xlabel(0  `" "Before" "broadcast" "' 1  `" "During/after" "broadcast" "', labsize(*1.05))
			legend(off)
		    xline(0 1, lcolor(gs13))
			text(10.71 1.05 "Uncritical", placement(3))
			text(3.57 1.04 "Critical of tournament", placement(3))
			text(85.71 1.05 "Critical of critical reporting", placement(3))			
			plotregion(lcolor(white)) 
		graphregion(color(white) lcolor(white) lalign(outside))			
	;
	#delimit cr
	graph export "$path\figure_A_7_2.pdf", as(pdf) replace	
		
	
********************************************************************************	
*	
********************************************************************************		
	
	*Closing graph windows
	graph close _all 
	
	*Clearing data
	clear all
	
	*End recording log file
	log close	

 
 
	

	
	
